<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/3/18
 * Time: 10:57
 */
namespace Tools\Controller;
use Common\Controller\FrontbaseController;

class AppointmentController extends FrontbaseController{

	protected $appointment_model;

	public function _initialize(){
		parent::_initialize();
		$this->appointment_model=D("ToolsAppointment");
	}

	public function add_post() {
		$post = I('post.');
		#实例化模型
		$model = M('ToolsAppointment');
		#增加操作
		$rst = $model -> add($post);
		#判断返回结果
		if($rst!==false){
		$arr['status'] = '1';
		$arr['msg'] = '您已预约成功！';
		$this->output($arr);

		}else{
			$arr['status'] = '0';
			$arr['msg'] = '预约失败，请重新预约，或联系客服人员！';
			$this->output($arr);

		}

	}
}